fold

inline fun <R> fold(default: R, transform: (T) -> R): R

Returns result of applying transform on the value of Some or default if this is None.

Return

Result of applying transform on the value of Some or default if this is None.

Parameters

default

Value to be returned if the option is empty.

transform

Function transforming Some value.

inline fun <R> fold(default: () -> R, transform: (T) -> R): R

Returns result of applying transform on the value of Some or default if this is None.

Return

Result of applying transform on the value of Some or default if this is None.

Parameters

default

Function producing value to be returned if the option is empty.

transform

Function transforming Some value.